Add DateTime::format_with token DSL#47
Conversation
|
Choir: GitHub Actions rollup reports all checks successful on the latest head — re-check review/merge policy on GitHub (not an approval or merge signal by itself). |
There was a problem hiding this comment.
Pull request overview
Adds a new public formatting API for DateTime that supports a small brace-token DSL, enabling custom UTC timestamp rendering beyond the existing RFC3339-style DateTime::format().
Changes:
- Introduces
DateTime::format_with(pattern)with brace-token parsing, brace escaping, andTempoErrorfor invalid tokens. - Adds test coverage for token substitution, literal passthrough, escaping, and unknown-token rejection.
- Updates the generated public interface (
pkg.generated.mbti) to expose the new API.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/tempo.mbt | Implements DateTime::format_with and token dispatch helper. |
| src/tempo_test.mbt | Adds blackbox tests validating formatting output and error behavior. |
| src/pkg.generated.mbti | Exposes DateTime::format_with in the generated public API surface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Choir: comment-only review received — routed to |
|
Choir: GitHub Copilot issue-thread comment observed on PR — parent notified with updated gate snapshot (not merge approval). |
|
Choir: fixes pushed by |
|
Choir: GitHub Actions rollup reports all checks successful on the latest head — re-check review/merge policy on GitHub (not an approval or merge signal by itself). |
|
Choir: fixes pushed by |
|
Choir: fixes pushed by |
|
Choir: GitHub Actions rollup reports all checks successful on the latest head — re-check review/merge policy on GitHub (not an approval or merge signal by itself). |
Closes bead tempo-dwz.4.
Adds DateTime::format_with(pattern) for brace-token custom UTC DateTime formatting with literal passthrough, doubled-brace escapes, fixed-width millisecond/nanosecond tokens, and TempoError rejection for unknown tokens.
Verification:
Verification
Generated by Choir from commands executed in the leaf workspace.
moon fmt --checkmoon test --target wasm-gcmoon test --target jsmoon test --target native